<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="u" uri="/iuie-tag"%>
<%@ taglib prefix="sys" uri="/sys-tag" %>
<%@ taglib prefix="lui" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>报表参数新增</title>
</head>
<lui:context/>
<u:View basePath="/res-system/report" userJS="reportParamsAdd" delayLoadJs="false">
<body>
    <lui:dialogBody>
        <form class="m-cust m-narrow" id='reportParamsAddFrm'>
        	<div class="form-group m-narrow row">
			    <div class="col-xs-12">
			        <div class="col-xs-3">
			            <label class='m-label m-float-right' for="paramKey">参数KEY：</label>
			        </div>
			        <div class="col-xs-8">
			            <input class='m-input form-control' id='paramKey' name='paramKey' maxlength="100" data-validate='true' data-not-empty='true' 
        					data-empty-text="参数KEY不能为空" data-0-regexp="^[a-zA-Z_][a-zA-Z0-9_.]{1,100}$" 
        					data-0-error-text="格式不合法<br>格式：以英文26个字母开头，大小写随意，内容仅能为100个英文字母或下划线或小数点"
							data-prompt="messager">
			        </div>
			    </div>
			</div>
			<div class="form-group m-narrow row">
			    <div class="col-xs-12">
			        <div class="col-xs-3">
			            <label class='m-label m-float-right' for="paramValue">参数值：</label>
			        </div>
			        <div class="col-xs-8">
			            <input class='m-input form-control' id='paramValue' name='paramValue' maxlength="4000" data-validate='true' 
			            	data-not-empty='true' data-empty-text="参数值不能为空">
			        </div>
			    </div>
			</div>
			<div class="form-group m-narrow row">
			    <div class="col-xs-12">
			        <div class="col-xs-3">
			            <label class='m-label m-float-right' for="paramName">参数名称：</label>
			        </div>
			        <div class="col-xs-8">
			            <input class='m-input form-control' id='paramName' name='paramName' maxlength="100" >
			        </div>
			    </div>
			</div>
			<input hidden="hidden" name="reportId" value="${requestScope.reportId }">
			<lui:ajax id="saveParamsAjax" url="${ctx }/report/params/add/one" formQuery="#reportParamsAddFrm" 
   				formSubmit="true" onSuccess="ReportParamsAddPage.onSaveSucc" type="post" contentType="application/x-www-form-urlencoded"/>
   			<c:if test="${not empty requestScope.paramKey }">
   				<lui:ajax id="findByIdAjax" url="${ctx }/report/params/find/id/${requestScope.reportId }/${requestScope.paramKey }/one" autoSend="true" 
	    			onSuccess="ReportParamsAddPage.onFindOneSucc" />
	    		<input name='oldParamKey' hidden='hidden' value='${requestScope.paramKey }'>
	    	</c:if>
        </form>
    </lui:dialogBody>
    <lui:dialogFooter>
       <button class="btn btn-primary m-btn" type="button" onclick="ReportParamsAddPage.save()">保存</button>
       <button class="btn btn-default m-btn" type="button" data-dismiss="dialog-box">关闭</button>
    </lui:dialogFooter>
</body>
</u:View>
</html>